﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<photogalleryMVC.Models.AlbumDetailModel>" %>
<%@ Import Namespace ="photogalleryMVC" %>



<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Details
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        


     <script type="text/javascript" src="<%=Url.Content("~/Scripts/PageScripts/AlbumDetails.js" ) %>"></script>
        <script type="text/javascript" src="<%=Url.Content("~/Scripts/Helpers/Pager.js" ) %>"></script>
    <p class="author">
        Album by <%=Html.DisplayFor(p=>p.OwnerName  ) %>
    </p>
    <div class ="hierarchy">
        <%=Html.HierarchyNavigation(i=>Url.Action( "Details","Album",new{id =i} ),Model.ParentAlbums,new{@class="reference"}  )%>
        <%=Model.ParentAlbums.Count ==0?"":"/" %>
        <%=Html.DisplayFor( m=>m.Title ) %>
    </div>
    
   
   <%if ((bool)ViewData["IsEditor"])
      {%>
      <%=Html .RouteLink("Add album",new{controller="Album",action="Create",parentAlbumId=Model.AlbumId },new{id="addalbum"}   )%>
      <%=Html.RouteLink("Add photo",new{controller="Photo",action="AddPhoto",albumId=Model.AlbumId } ,new{id ="addphoto"}  ) %>
    <%
      }%>

    <%using (Html.BeginForm("ItemsOnPage", "Album", new { returnUrl = Request.RawUrl },FormMethod.Post ,new{@class="PageSize"}  ))
      {%>
        <span>Items on page:</span>
        <%=Html.DropDownList("OnPage", Model.QuantityList)%>
        <input type="submit" value="Change" /> 
    <%
      }%>
    
    
      

        <div id="itemContainer<%=Model.AlbumId %>" data-pages="<%=Model.TotalPages   %>" >
             <%Html.RenderPartial("AlbumItemsPartialView", Model);%>
        </div>
        

      
</asp:Content>
